package com.xs.project.controller;

import com.xs.project.common.Result;
import com.xs.project.pojo.vo.CourseResourceRequest;
import com.xs.project.pojo.vo.StudentLeaveClassReq;
import com.xs.project.pojo.vo.UserInfoAndCourseReq;
import com.xs.project.pojo.vo.resp.CourseResourceResp;
import com.xs.project.pojo.vo.resp.StudentLeaveClassResp;
import com.xs.project.pojo.vo.resp.UserInfoAndCourse;
import com.xs.project.service.IClassManagerService;
import com.xs.project.service.ICourseResourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/classManager")
@Api(tags = "班级管理")
public class ClassManagerController {
    @Resource
    private IClassManagerService classManagerService;

    @ApiOperation(value = "列表-学生请假", notes = "学生请假")
    @PostMapping(value = "/selectLeaveClass")
    public Result<List<StudentLeaveClassResp>> selectLeaveClass(@RequestBody StudentLeaveClassReq request) {
        return classManagerService.selectLeaveClass(request);
    }

    @ApiOperation(value = "审核-学生请假", notes = "学生请假")
    @GetMapping(value = "/handleLeaveClass")
    public Result<Boolean> handleLeaveClass(Integer id,String status) {
        return Result.success(classManagerService.handleLeaveClass(id,status));
    }

    @ApiOperation(value = "学生基本上课信息", notes = "学生基本上课信息")
    @PostMapping(value = "/selectUserInfoAndCourse")
    public Result<List<UserInfoAndCourse>> selectUserInfoAndCourse(@RequestBody UserInfoAndCourseReq request) {
        return classManagerService.selectUserInfoAndCourse(request);
    }
}
